namespace Digitalmes.Application.Mes.Qulities.Defects;

/// <summary>
/// 缺陷定义 DTO 对象。
/// </summary>
public sealed class QcDefectDefineDto : Dto
{
    /// <summary>
    /// 缺陷代码，用于快速标记缺陷类型（如 "D001"、"D002"）。
    /// </summary>
    [NotNull]
    public string? DefectCode { get; set; }

    /// <summary>
    /// 缺陷名称（如 "尺寸超差"、"表面划伤"、"焊接虚焊"）。
    /// </summary>
    [NotNull]
    public string? DefectName { get; set; }

    /// <summary>
    /// 缺陷类型，如：Appearance->外观缺陷、Function->功能缺陷、Assembly->装配缺陷、Material->材料缺陷 等。
    /// </summary>
    [NotNull]
    public string? DefectType { get; set; }

    /// <summary>
    /// 缺陷类型描述。
    /// </summary>
    public string? DefectTypeDesc { get; set; }

    /// <summary>
    /// 缺陷描述，对缺陷的详细说明，便于操作员或质检员理解。
    /// </summary>
    public string? DefectDesc { get; set; }

    /// <summary>
    /// 严重等级。
    /// </summary>
    public DefectLevelEnum DefectLevel { get; set; }

    public string? DefectLevelDesc => DefectLevel.Description();

    /// <summary>
    /// 排序
    /// </summary>
    public int Order { get; set; }

    /// <summary>
    /// 启用状态（0->停用，1->启用）
    /// </summary>
    public EnabledStatusEnum Status { get; set; }

    public string? CreatedBy { get; set; }

    public DateTime CreatedTime { get; set; }

    public string? UpdatedBy { get; set; }

    public DateTime? UpdatedTime { get; set; }
}
